//
//  AppDelegate+DTCRootController.m
//  BluetoothProject
//
//  Created by JianWei Chen on 16/9/5.
//  Copyright © 2016年 JianWei Chen. All rights reserved.
//

#import "AppDelegate+DTCRootController.h"
#import "MILLoginViewController.h"
#import "MILHomePageViewController.h"

@interface AppDelegate ()

@end



@implementation AppDelegate (DTCRootController)

- (void)setRootViewController
{
    if ([EXRACT_OBJECT(LOGIN) isEqualToString:@"YES"]) {
        MILHomePageViewController *milHomePageVC = [[MILHomePageViewController alloc]init];
        self.window.rootViewController = [[UINavigationController alloc]initWithRootViewController:milHomePageVC];
    } else {
        UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
        self.window.rootViewController = [storyboard instantiateViewControllerWithIdentifier:@"LoginVC"];
    }
//    LoginApi *api = [[LoginApi alloc]initWithDic:@{@"username":@"18359100080",@"password":@"123456"}];
//    [api startWithCompletionAnimation:YES andBlockWithSuccess:^(__kindof YTKBaseRequest * _Nonnull request) {
//        NSLog(@"%@",request.responseObject);
//    } backfailure:^(__kindof YTKBaseRequest * _Nonnull request) {
//        
//    } requestFailure:^(__kindof YTKBaseRequest * _Nonnull request) {
//        
//    }];
}

@end
